//untested 
@MenuItem("GameObject/Apply Material") 
static function ApplyMaterial () 
{        
   var objects = Selection.GetFiltered(GameObject, SelectionMode.Assets); 
   var material = Selection.GetFiltered(Material, SelectionMode.Assets); 
   if(objects && material && material[0]) 
   { 
      for(var o : GameObject in objects) 
      { 
         if(o.renderer) o.renderer.material = material[0];    
      }    
   } 
} 